package com.linkhub.oms.entity.resulttype;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.github.yulichang.annotation.EntityMapping;
import com.linkhub.oms.common.enums.mp.OrderProductTypeEnum;

import com.linkhub.oms.common.util.QtBeanUtil;
import com.linkhub.oms.entity.LocalProductEntity;
import com.linkhub.oms.entity.OrderProductEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.Transient;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @Description: OrderLocalProductResultEntity
 * @Author: echo
 * @Date: 2024/3/31 22:05
 * @Version: 1.0
 */
@Data
public class OrderLocalProductResultEntity implements Serializable {

    @ApiModelProperty(value = "sku")
    private String sku;


    @ApiModelProperty(value = "系统orderId")
    private String sysOrderId;

    @ApiModelProperty(value = "系统商店id")
    private String sysShopId;

    @ApiModelProperty(value = "平台商品id")
    private Long shopProductId;

    @ApiModelProperty(value = "平台商品skuId")
    private Long shopSkuId;

    @ApiModelProperty(value = "本地商品skuId")
    private String skuId;

    @ApiModelProperty(value = "购买sku")
    private String skuTitle;

    @ApiModelProperty(value = "商品单价")
    private String price;

    @ApiModelProperty(value = "商品单价币种")
    private String currencyCode;

    @ApiModelProperty(value = "当前订单该商品购买数量")
    private Integer currentQuantity;


    public OrderProductEntity toOrderLocalProduct() {
        OrderProductEntity orderProduct = new OrderProductEntity();

        QtBeanUtil.copyProperties(this,orderProduct);
        orderProduct.setSkuTitle(this.getSku());
        orderProduct.setCurrentQuantity(this.getCurrentQuantity());
        orderProduct.setProductType(OrderProductTypeEnum.LOCAL);
        return orderProduct;

    }

}
